package com.yinhe.music.yhmusic.widget;

import android.content.Context;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 *
 * @author hasee
 * @date 2017/8/29
 */

public class RecmmendItemDecoration extends RecyclerView.ItemDecoration {
    private int space;

    public RecmmendItemDecoration(Context context, int space) {
        this.space = (int) (space * context.getResources().getDisplayMetrics().density);
    }

    @Override
    public void getItemOffsets(Rect outRect, View view,
                               RecyclerView parent, RecyclerView.State state) {
        outRect.set(space / 2, space, space / 2, 0);
    }
}
